gdk/wayland: Fix pointer-gestures version selection
authorVlad Zahorodnii <vlad.zahorodnii@kde.org>
Mon, 21 Jun 2021 06:22:29 +0000 (09:22 +0300)
committerVlad Zahorodnii <vlad.zahorodnii@kde.org>
Mon, 21 Jun 2021 06:51:45 +0000 (09:51 +0300)
version == GDK_ZWP_POINTER_GESTURES_V1_VERSION will fail if the
compositor implements version 2 of pointer-gestures-v1.

gdk/wayland/gdkdisplay-wayland.c

index 0dcfb09182dcbc77d3939e35a92b26cb1185bbb0..4caae38066c9fc0900a80a20a2807b38a385826b 100644 (file)
@@ -432,12 +432,12 @@ gdk_registry_handle_global (void               *data,
       display_wayland->subcompositor =
         wl_registry_bind (display_wayland->wl_registry, id, &wl_subcompositor_interface, 1);
     }
-  else if (strcmp (interface, "zwp_pointer_gestures_v1") == 0 &&
-           version == GDK_ZWP_POINTER_GESTURES_V1_VERSION)
+  else if (strcmp (interface, "zwp_pointer_gestures_v1") == 0)
     {
       display_wayland->pointer_gestures =
         wl_registry_bind (display_wayland->wl_registry,
-                          id, &zwp_pointer_gestures_v1_interface, version);
+                          id, &zwp_pointer_gestures_v1_interface,
+                          MIN (version, GDK_ZWP_POINTER_GESTURES_V1_VERSION));
     }
   else if (strcmp (interface, "zwp_primary_selection_device_manager_v1") == 0)
     {